package com.platform.controller.tenant;

import com.platform.common.annotation.Log;
import com.platform.common.core.domain.entity.SysUser;
import com.platform.common.core.page.TableDataInfo;
import com.platform.common.enums.BusinessType;
import com.platform.common.utils.SecurityUtils;
import com.platform.system.domain.vo.chip.AuditRecordsVo;
import com.platform.system.service.ISysAuditRecordsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

/**
 * @author Huangkai
 */
@Slf4j
@RestController
@RequestMapping("/tenant/auditRecord")
public class TenantAuditRecordsController {

    @Autowired
    ISysAuditRecordsService sysAuditRecordsService;

    @PreAuthorize("@ss.hasPermi('tenant:approve:list')")
    @Log(title = "查询审批记录列表", businessType = BusinessType.OTHER)
    @GetMapping("/selectAuditRecordsList")
    public TableDataInfo selectAuditRecordsList(AuditRecordsVo auditRecordsVo) {
        SysUser sysUser = SecurityUtils.getLoginUser().getUser();
        auditRecordsVo.setTenantUid(sysUser.getTenantUid());
        return sysAuditRecordsService.selectAuditRecordsList(auditRecordsVo);
    }
}
